using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using Castle.ActiveRecord;
using Castle.ActiveRecord.Framework.Config;
using Stormwind.Testing.Entities;
using Stormwind.Core.Data;
using System.Data;
using System.IO;
using System.Xml;
using Stormwind.Core.Configuration;

namespace Stormwind.Testing {
	/// <summary>
	/// The basic test suite for Stormwind Report Server.
	/// </summary>
	[TestFixture]
	public class BusinessTestSuite : BaseTestFixture {

		/// <summary>
		/// Tests the customer and order objects.
		/// </summary>
		[Test]
		public void TestGetUsers() {
			//string xyz = Business.Rules.UserManager.GetAllUsers();
		}

		/// <summary>
		/// Tests the report data retrieve engine.
		/// </summary>
		[Test]
		public void TestGetReportData() {
			DataDefinition def = ObjectMother.CreateSampleDataDefinition();

			string xml = DataBroker.GetData(def);

			Assert.AreNotEqual(string.Empty, xml);
		}

		/// <summary>
		/// Tests the report engine configuration section.
		/// </summary>
		[Test]
		public void TestConfigSection() {
			IConfiguration config = StormwindConfiguration.Current;

			Assert.AreEqual("Stormwind.Core.Data.ARDataBroker, Stormwind.Core", config.DataBroker);
		}
	}
}
